<?php
require_once "object.php";
header("Content-type: application/json; charset=Utf-8");
$db = GetDB();

$res = $db->query("select `name`,`size`,`date` as `lastmod`,`src`,`thumb` as `url`,`width`,`height` from `images` order by `date` desc");
$ret = array();
if($res && mysql_num_rows($res)>0)
{
	while($row = mysql_fetch_assoc($res))
	{
		array_push($ret,$row);
	}

}

$o=array('images'=>$ret);
echo Array2Json($o);
echo mysql_error();
@mysql_free_result($res);
?>